﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/b.master" %>

<script runat="server">

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link rel="shortcut icon" href="favicon.ico">
<style type="text/css">
body{
	background:url(assets/img/bg/login_bg.jpg) no-repeat center center;
	background-size:100% 100%;
	height: 100%;
}
.middle-box{
	font-family: "Microsoft YaHei", SimHei;
}
.middle-box h1{
	font-size: 124px;
}
.logo-name{
	letter-spacing: 0;
}
.btn-login{
	background: url(assets/img/bg/login_btn_bg.png) no-repeat center;
	background-size: cover;
    font-size: 18px;
    padding: 4px;
    color: #231916;
    letter-spacing: 2px;
    border: 0;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" Runat="Server">
<div class="middle-box text-center loginscreen animated">
	<div>
		<div>
			<h1 class="logo-name">NM+</h1>
		</div>
		<h3>欢迎使用 <strong>NM+后台系统</strong></h3>
		<form class="m-t" role="form" autocomplete="off">
			<div class="form-group">
				<input type="text" id="loginaccount" class="form-control" 
					placeholder="用户名" autocomplete="off" value="admin" />
			</div>
			<div class="form-group">
				<input type="password" id="password" class="form-control" 
					placeholder="密码" autocomplete="off" value="1qaz2wsx" />
			</div>
			<button type="button" class="btn btn-block m-b btn-login">登录</button>
		</form>
	</div>
</div>  
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footer" runat="server">
<script type="text/javascript">
	$(function () {
//		$('.middle-box').addClass('pulse');
		
		$(".btn-login").click(function () {
			var loginaccount = $('#loginaccount').val();
			var password = $('#password').val();
			if(Y.checkNull(loginaccount.trim())){
				layer.tips('请输入用户名', '#loginaccount');
				return false;
			}
			if(Y.checkNull(password.trim())){
				layer.tips('请输入密码', '#password');
				return false;
			}
			
			Y.API2("Login", "Login", { "UserName": loginaccount, "PassWord": md5(password) }, function (data) {
				if (data.Success == false) {
					layer.alert(data.Message);
				} else {
					sessionStorage.setItem('login-info', JSON.stringify(data));
					var returnUrl = '<%=this.Request.Get("return","/index.aspx") %>';
					location.href = returnUrl;
				}
			});
		});
		
		$(document).keyup(function(event){   
			//获取当前按键的键值   
			//jQuery的event对象上有一个which的属性可以获得键盘按键的键值   
			var keycode = event.which;   
			//处理回车的情况   
			if(keycode==13){
				$(".btn-login").click();
			} 
		});
	});
</script>
</asp:Content>